package com.blue.gateway.dto;

import lombok.Data;

/**
 * @author xiaoyiming
 * @date 2020/5/5 14:39
 * @depiction
 */
@Data
public class Result<T> {
    private int code;
    private String message;
    private T data;

    public Result(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public Result(int code, String message, T date) {
        this.code = code;
        this.message = message;
        this.data = date;
    }

    public boolean isSuccess() {
        return this.code == 0;
    }
    public boolean isFail() {
        return this.code != 0;
    }
}
